<?php
class Magentochina_Bundlepromotion_Block_Bundlepromotion extends Mage_Catalog_Block_Product_View
{
	public function _prepareLayout()
    {
		return parent::_prepareLayout();
    }
    
    public function getBundlepromotion()     
     { 
        if (!$this->hasData('bundlepromotion')) {
            $this->setData('bundlepromotion', Mage::registry('bundlepromotion'));
        }
        return $this->getData('bundlepromotion');
        
    }
	
	public function isBundlepromotion()
	{
		return $this->getBundledPromotion()->getSize();
	}
	
	public function getBundledPromotion()
	{		
		$product = $this->getProduct();
		$bundlepromotions_data = Mage::getModel('bundlepromotion/bundlepromotion')->getBundledPromotions( $product->getId() );
		return $bundlepromotions_data;
	}
}